From 5cb0da488e23343b24ca582ab6279ec291075194 Mon Sep 17 00:00:00 2001 From: Jan Vesely Date: Fri, 20 Jul 2018 01:55:54 -0400 Subject: [PATCH] meson: Generate babl.map based on export_symbols file Fixing issue #20 Signed-off-by: Jan Vesely --- babl.map | 75 ------------------------------------------------ babl/meson.build | 16 +++++++++++ gen_babl_map.py | 11 +++++++ meson.build | 1 - 4 files changed, 27 insertions(+), 76 deletions(-) delete mode 100644 babl.map create mode 100644 gen_babl_map.py diff --git a/babl.map b/babl.map deleted file mode 100644 index 348db8f..0000000 --- a/babl.map +++ /dev/null @@ -1,75 +0,0 @@ -V0_1_0 { - global: - babl_component; - babl_component_new; - babl_conversion_get_destination_space; - babl_conversion_get_source_space; - babl_conversion_new; - babl_cpu_accel_get_support; - babl_exit; - babl_fast_fish; - babl_fish; - babl_format; - babl_format_exists; - babl_format_get_bytes_per_pixel; - babl_format_get_model; - babl_format_get_n_components; - babl_format_get_space; - babl_format_get_type; - babl_format_has_alpha; - babl_format_is_format_n; - babl_format_is_palette; - babl_format_n; - babl_format_new; - babl_format_with_space; - babl_free; - babl_get_name; - babl_get_user_data; - babl_get_version; - babl_icc_make_space; - babl_icc_get_key; - babl_init; - babl_introspect; - babl_malloc; - babl_model; - babl_model_new; - babl_new_palette; - babl_palette_reset; - babl_palette_set_palette; - babl_process; - babl_process_rows; - babl_sampling; - babl_set_user_data; - babl_space; - babl_space_from_xyz; - babl_space_get_rgbtoxyz; - babl_space_to_xyz; - babl_ticks; - babl_type; - babl_type_new; - babl_space_to_icc; - babl_db_exist_by_name; - babl_db_find; - babl_db_init; - babl_db_exist_by_id; - babl_db_each; - babl_formats_count; - babl_format_class_for_each; - babl_model_class_for_each; - babl_type_class_for_each; - babl_conversion_class_for_each; - babl_set_extender; - babl_extension_quiet_log; - babl_fish_path; - babl_extender; - babl_class_name; - babl_sanity; - babl_type_is_symmetric; - babl_model_is_symmetric; - babl_fish_db; - babl_polynomial_approximate_gamma; - babl_backtrack; - - local: - *; -}; diff --git a/babl/meson.build b/babl/meson.build index 29ac00b..77e69a5 100644 --- a/babl/meson.build +++ b/babl/meson.build @@ -1,6 +1,21 @@ bablInclude = include_directories('.') subdir('base') +version_script = 'babl.map' +export_symbols = join_paths(meson.source_root(), 'export-symbols') +version_script_target = custom_target(version_script, + input : [ export_symbols, ] , + output: [ version_script ] , + command: [ + 'python', + join_paths(meson.source_root(), 'gen_babl_map.py'), + export_symbols, + version_script, + ], + capture: true, +) + + # Linker arguments babl_link_args = [ '-Wl,--version-script,' + version_script, @@ -116,6 +131,7 @@ babl = library( link_whole: [ babl_base, ], link_args: [ babl_link_args, ], dependencies: [ math, thread, dl, ], + link_depends: [ version_script_target, ], version: so_version, install: true, ) diff --git a/gen_babl_map.py b/gen_babl_map.py new file mode 100644 index 0000000..644ea61 --- /dev/null +++ b/gen_babl_map.py @@ -0,0 +1,11 @@ +import sys + +export_symbols=sys.argv[1] +version_file=sys.argv[2] + +with open(export_symbols, 'r') as syms, \ + open(version_file, 'w') as version: + version.write("V0_1_0 {\n global:\n") + for sym in syms: + version.write(" {};\n".format(sym.strip())) + version.write(" local:\n *;\n};\n") diff --git a/meson.build b/meson.build index 956da08..31540d0 100644 --- a/meson.build +++ b/meson.build @@ -325,7 +325,6 @@ configure_file( # Subdirs rootInclude = include_directories('.') -version_script = join_paths(meson.current_source_dir(), 'babl.map') subdir('babl') subdir('extensions') -- 2.30.2